<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Java项目开发笔记_05 | MoneyLee’s Blog</title><meta name="author" content="李财"><meta name="copyright" content="李财"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Spring5.X ⾯面向切⾯面编程 AOP 什么是AOP Aspect Oriented Program ⾯向切面编程 在不改变原有逻辑上增加额外的功能，比如解决系统层面的问题，或者增加新的功能      场景 权限控制 缓存 日志处理 事务控制   AOP思想把功能分两个部分，分离系统中的各种关注点 核心关注点 业务的主要功能   横切关注点 非核心、额外增加的功能     好处 减少代码侵入">
<meta property="og:type" content="article">
<meta property="og:title" content="Java项目开发笔记_05">
<meta property="og:url" content="https://moneylee.gitee.io/myblog/2020/06/09/Java%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0_05/index.html">
<meta property="og:site_name" content="MoneyLee’s Blog">
<meta property="og:description" content="Spring5.X ⾯面向切⾯面编程 AOP 什么是AOP Aspect Oriented Program ⾯向切面编程 在不改变原有逻辑上增加额外的功能，比如解决系统层面的问题，或者增加新的功能      场景 权限控制 缓存 日志处理 事务控制   AOP思想把功能分两个部分，分离系统中的各种关注点 核心关注点 业务的主要功能   横切关注点 非核心、额外增加的功能     好处 减少代码侵入">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg">
<meta property="article:published_time" content="2020-06-09T09:14:20.000Z">
<meta property="article:modified_time" content="2021-09-19T14:35:25.216Z">
<meta property="article:author" content="李财">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg"><link rel="shortcut icon" href="/myblog/img/favicon.png"><link rel="canonical" href="https://moneylee.gitee.io/myblog/2020/06/09/Java%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0_05/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/myblog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/myblog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Java项目开发笔记_05',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-09-19 22:35:25'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.0.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">46</div></a></div><div class="data-item"><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="data-item"><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 影音</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/myblog/">MoneyLee’s Blog</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 影音</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Java项目开发笔记_05</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-06-09T09:14:20.000Z" title="发表于 2020-06-09 17:14:20">2020-06-09</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-09-19T14:35:25.216Z" title="更新于 2021-09-19 22:35:25">2021-09-19</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/myblog/categories/Java/">Java</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="Java项目开发笔记_05"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h3 id="Spring5-X-⾯面向切⾯面编程-AOP"><a href="#Spring5-X-⾯面向切⾯面编程-AOP" class="headerlink" title="Spring5.X ⾯面向切⾯面编程 AOP"></a><strong>Spring5.X</strong> ⾯面向切⾯面编程 <strong>AOP</strong></h3><ul>
<li>什么是AOP<ul>
<li>Aspect Oriented Program ⾯向切面编程</li>
<li>在不改变原有逻辑上增加额外的功能，比如解决系统层面的问题，或者增加新的功能   </li>
</ul>
</li>
<li>场景<ul>
<li>权限控制</li>
<li>缓存</li>
<li>日志处理</li>
<li>事务控制</li>
</ul>
</li>
<li>AOP思想把功能分两个部分，分离系统中的各种关注点<ul>
<li>核心关注点<ul>
<li>业务的主要功能</li>
</ul>
</li>
<li>横切关注点<ul>
<li>非核心、额外增加的功能</li>
</ul>
</li>
</ul>
</li>
<li>好处<ul>
<li>减少代码侵入、解耦</li>
<li>可以统一处理横切逻辑</li>
<li>方便添加和切除横切逻辑</li>
</ul>
</li>
</ul>
<hr>
<h3 id="AOP⾯向切⾯编程核心概念"><a href="#AOP⾯向切⾯编程核心概念" class="headerlink" title="AOP⾯向切⾯编程核心概念"></a><strong>AOP</strong>⾯向切⾯编程核心概念</h3><ul>
<li><p>横切、通知、连接点、切⼊点、切⾯</p>
</li>
<li><p>横切关注点 </p>
<ul>
<li>对哪些⽅法进行拦截，拦截后怎么处理，这些就叫横切关注点</li>
<li>比如 权限认证、⽇志、事物</li>
</ul>
</li>
<li><p>通知 Advice</p>
<ul>
<li>在特定的切⼊点上执⾏的增强处理  </li>
<li>记录日志，控制事务 ，提前编写好通用的模块，需要的地⽅直接调⽤</li>
</ul>
</li>
<li><p>连接点 JointPoint</p>
<ul>
<li>要用通知的地方，业务流程在运⾏过程中需要插入切面的具体位置 </li>
<li> ⼀般是方法的调用前后，全部方法都可以是连接点</li>
<li>只是概念，没啥特殊  </li>
</ul>
</li>
<li><p>切入点 Pointcut </p>
<ul>
<li>不能全部⽅法都是连接点，通过特定的规则来筛选连接点, 就是Pointcut，选中那⼏个你想要的方法</li>
<li>在程序中主要体现为书写切入点表达式(通过通配、正则表达式)过滤出特定的一组 JointPoint连接点</li>
<li>过滤出相应的 Advice 将要发生的joinpoint地方  </li>
</ul>
</li>
<li><p>切面 Aspect </p>
<ul>
<li>通常是⼀个类，⾥面定义 切入点**+**通知 , 定义在什么地方; 什么时间点、做什么事情</li>
<li>通知 <strong>advice</strong>指明了时间和做的事情(前置、后置等)</li>
<li>切⼊点 <strong>pointcut</strong> 指定在什么地⽅⼲这个事情</li>
<li>web接⼝设计中，web层-&gt;网关层-&gt;服务层-&gt;数据层，每⼀层之间也是⼀个切⾯面，对象和对象，⽅法和⽅法之间都是一个切面  </li>
</ul>
</li>
<li><p>目标 target </p>
<ul>
<li>⽬标类，真正的业务逻辑，可以在目标类不知情的条件下，增加新的功能到目标类的链路上 </li>
</ul>
</li>
<li><p>织⼊Weaving</p>
<ul>
<li>把切面(某个类)应用到目标函数的过程称为织⼊  </li>
</ul>
</li>
<li><p>AOP代理</p>
<ul>
<li>AOP框架创建的对象，代理就是目标对象的加强</li>
<li>Spring中的AOP代理可以使JDK动态代理，也可以是CGLIB代理</li>
</ul>
</li>
</ul>
<hr>
<h3 id="AOP⾥⾯的通知Advice类型讲解"><a href="#AOP⾥⾯的通知Advice类型讲解" class="headerlink" title="AOP⾥⾯的通知Advice类型讲解"></a><strong>AOP</strong>⾥⾯的通知<strong>Advice</strong>类型讲解</h3><ul>
<li>@Before前置通知<ul>
<li>在执⾏⽬标方法之前运行  </li>
</ul>
</li>
<li>@After后置通知<ul>
<li>在目标方法运行结束之后  </li>
</ul>
</li>
<li>@AfterReturning返回通知<ul>
<li>在⽬标方法正常返回值后运行  </li>
</ul>
</li>
<li>@AfterThrowing异常通知<ul>
<li>在⽬标⽅法出现异常后运行  </li>
</ul>
</li>
<li>@Around环绕通知<ul>
<li>在目标方法完成前、后做增强处理 ,环绕通知是最重要的通知类型 ,像事务,⽇志等都是环绕通知,注意编程中核心是⼀个ProceedingJoinPoint，需要⼿动执行 joinPoint.procced()  </li>
</ul>
</li>
</ul>
<hr>
<h3 id="AOP切入点表达式讲解"><a href="#AOP切入点表达式讲解" class="headerlink" title="AOP切入点表达式讲解"></a><strong>AOP</strong>切入点表达式讲解</h3><ul>
<li><p>切⼊点表示式</p>
<ul>
<li><p>除了返回类型、⽅法名和参数外，其它项都是可选的 (修饰符基本都是省略不写) </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"> 访问修饰符      返回值类型(必填)   包和类            ⽅法(必填)</span><br><span class="line">execution(modifiers-pattern? ret-type-pattern declaring-type-pattern?name- pattern(param-pattern) throws-pattern?)</span><br></pre></td></tr></table></figure></li>
<li><p>@Pointcut(“execution(public int net.xdclass.sp.service.VideoOrderService.*(..))”) </p>
</li>
</ul>
</li>
<li><p>常见匹配语法</p>
<ul>
<li>*:匹配任何数量字符 单个; </li>
<li>..:匹配任何数量字符,可以多个，在类型模式中匹配任何数量子包;在方法参数模式中匹配 任何数量参数</li>
</ul>
</li>
<li><pre><code>() 匹配⼀个不接受任何参数的⽅法
(..) 匹配⼀个接受任意数量参数的⽅法
(*) 匹配了一个接受⼀个任何类型的参数的方法
(*,Integer) 匹配了一个接受两个参数的方法，其中第一个参数是任意类型，第二个参数必须 是Integer类型
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">*   常⻅例子</span><br><span class="line"></span><br><span class="line">  * 任意公共方法 </span><br><span class="line"></span><br></pre></td></tr></table></figure>
execution(public * *(..))
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">* 任何一个名字以“save”开始的⽅法 </span><br><span class="line"></span><br></pre></td></tr></table></figure>
execution(* save*(..))
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">* VideoService接口定义的任意方法(识别) </span><br><span class="line"></span><br></pre></td></tr></table></figure>
 execution(* net.xdclass.service.VideoService.*(..))
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">* 在service包中定义的任意⽅方法(识别) </span><br><span class="line"></span><br></pre></td></tr></table></figure>
execution(* net.xdclass.service.*.*(..))
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">* 匹配 service 包,⼦孙包下所有类的所有⽅法(识别) </span><br><span class="line"></span><br></pre></td></tr></table></figure>
execution(* net.xdclass.service..*.*(..))
</code></pre>
</li>
</ul>
<hr>
<h3 id="Spring-AOP⾥面的代理知识"><a href="#Spring-AOP⾥面的代理知识" class="headerlink" title="Spring AOP⾥面的代理知识"></a><strong>Spring AOP</strong>⾥面的代理知识</h3><h4 id="动态代理和静态代理"><a href="#动态代理和静态代理" class="headerlink" title="动态代理和静态代理"></a>动态代理和静态代理</h4><ul>
<li>什么是代理<ul>
<li>为某一个对象创建一个代理对象，程序不直接用原本的对象，而是由创建的代理对象来控制原对象，通过代理类这中间一层，能有效控制对委托类对象的直接访问，也可以很好的隐藏和保护委托类对象，同时也为实施不同控制策略预留了控件</li>
<li>A -&gt; B -&gt;C</li>
</ul>
</li>
<li>什么是静态代理<ul>
<li>由程序创建或特定工具自动生成源代码，在程序运行前，代理的.class文件已经存在</li>
</ul>
</li>
<li>什么是动态代理<ul>
<li>在程序运行时，运用反射机制动态创建而成，无需手动编写代码<ul>
<li>JDK动态代理</li>
<li>CGLIB动态代理</li>
</ul>
</li>
</ul>
</li>
</ul>
<hr>
<h3 id="代理模式之静态代理"><a href="#代理模式之静态代理" class="headerlink" title="代理模式之静态代理"></a>代理模式之静态代理</h3><ul>
<li>静态代理的优点<ul>
<li>代理使客户端不需要知道实现类是什么，怎么做的，而客户端只需要知道代理即可</li>
<li>方便增加功能，拓展业务逻辑</li>
</ul>
</li>
<li>缺点<ul>
<li>代理类中出现大量沉余代码，非常不利于拓展和维护</li>
<li>如果接口增加一个方法，除了所有实现类需要实现这个方法外，所有代理类也需要实现此方法，增加了代码维护的复杂度</li>
</ul>
</li>
</ul>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">李财</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://moneylee.gitee.io/myblog/2020/06/09/Java%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0_05/">https://moneylee.gitee.io/myblog/2020/06/09/Java%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0_05/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://moneylee.gitee.io/myblog" target="_blank">MoneyLee’s Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/myblog/2020/06/10/CentOS7.4%E5%AE%89%E8%A3%85java8%E7%8E%AF%E5%A2%83/"><img class="prev-cover" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="onerror=null;src='/myblog/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">CentOS7.4安装java8环境</div></div></a></div><div class="next-post pull-right"><a href="/myblog/2020/06/08/Java%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0_03/"><img class="next-cover" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="onerror=null;src='/myblog/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Java项目开发笔记_03</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/myblog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">李财</div><div class="author-info__description">开发者</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">46</div></a></div><div class="card-info-data-item"><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="card-info-data-item"><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitee.com/moneylee" target="_blank" title="Gitee"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:licai_1024@hotmail.com" target="_blank" title=""><i class="fas fa-envelope"></i></a><a class="social-icon" href="/myblog/img/mywechat.jpg" target="_blank" title=""><i class="fab fa-weixin"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Spring5-X-%E2%BE%AF%E9%9D%A2%E5%90%91%E5%88%87%E2%BE%AF%E9%9D%A2%E7%BC%96%E7%A8%8B-AOP"><span class="toc-number">1.</span> <span class="toc-text">Spring5.X ⾯面向切⾯面编程 AOP</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#AOP%E2%BE%AF%E5%90%91%E5%88%87%E2%BE%AF%E7%BC%96%E7%A8%8B%E6%A0%B8%E5%BF%83%E6%A6%82%E5%BF%B5"><span class="toc-number">2.</span> <span class="toc-text">AOP⾯向切⾯编程核心概念</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#AOP%E2%BE%A5%E2%BE%AF%E7%9A%84%E9%80%9A%E7%9F%A5Advice%E7%B1%BB%E5%9E%8B%E8%AE%B2%E8%A7%A3"><span class="toc-number">3.</span> <span class="toc-text">AOP⾥⾯的通知Advice类型讲解</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#AOP%E5%88%87%E5%85%A5%E7%82%B9%E8%A1%A8%E8%BE%BE%E5%BC%8F%E8%AE%B2%E8%A7%A3"><span class="toc-number">4.</span> <span class="toc-text">AOP切入点表达式讲解</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Spring-AOP%E2%BE%A5%E9%9D%A2%E7%9A%84%E4%BB%A3%EF%A7%A4%E7%9F%A5%E8%AF%86"><span class="toc-number">5.</span> <span class="toc-text">Spring AOP⾥面的代理知识</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%8A%A8%E6%80%81%E4%BB%A3%E7%90%86%E5%92%8C%E9%9D%99%E6%80%81%E4%BB%A3%E7%90%86"><span class="toc-number">5.1.</span> <span class="toc-text">动态代理和静态代理</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F%E4%B9%8B%E9%9D%99%E6%80%81%E4%BB%A3%E7%90%86"><span class="toc-number">6.</span> <span class="toc-text">代理模式之静态代理</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/myblog/2021/08/14/Flutter%E5%8F%91%E5%B8%83%E4%BB%A3%E7%A0%81%E5%88%B0%E4%BB%93%E5%BA%93/" title="Flutter发布代码到PUB仓库"><img src="http://file.moneylee.top/uPic/flutter.png" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Flutter发布代码到PUB仓库"/></a><div class="content"><a class="title" href="/myblog/2021/08/14/Flutter%E5%8F%91%E5%B8%83%E4%BB%A3%E7%A0%81%E5%88%B0%E4%BB%93%E5%BA%93/" title="Flutter发布代码到PUB仓库">Flutter发布代码到PUB仓库</a><time datetime="2021-08-14T12:04:03.000Z" title="发表于 2021-08-14 20:04:03">2021-08-14</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/21/iOS%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" title="iOS机器学习"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="iOS机器学习"/></a><div class="content"><a class="title" href="/myblog/2020/08/21/iOS%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" title="iOS机器学习">iOS机器学习</a><time datetime="2020-08-21T02:04:10.000Z" title="发表于 2020-08-21 10:04:10">2020-08-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/20/Docker%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86/" title="Docker 基础知识整理"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Docker 基础知识整理"/></a><div class="content"><a class="title" href="/myblog/2020/08/20/Docker%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86/" title="Docker 基础知识整理">Docker 基础知识整理</a><time datetime="2020-08-20T12:12:02.000Z" title="发表于 2020-08-20 20:12:02">2020-08-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/19/Flutter/" title="Flutter"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Flutter"/></a><div class="content"><a class="title" href="/myblog/2020/08/19/Flutter/" title="Flutter">Flutter</a><time datetime="2020-08-19T02:04:03.000Z" title="发表于 2020-08-19 10:04:03">2020-08-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/19/iOS%20AR%E5%92%8CARKit4/" title="iOS AR和ARKit4"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="iOS AR和ARKit4"/></a><div class="content"><a class="title" href="/myblog/2020/08/19/iOS%20AR%E5%92%8CARKit4/" title="iOS AR和ARKit4">iOS AR和ARKit4</a><time datetime="2020-08-19T02:04:03.000Z" title="发表于 2020-08-19 10:04:03">2020-08-19</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 李财</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/myblog/js/utils.js"></script><script src="/myblog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>